package cn.com.css.taxInspection.gt3.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.css.taxInspection.gt3.mapper.JcAjztTjZxDlMapper;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjZxDlEntity;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjZxEntity;
import cn.com.css.taxInspection.gt3.service.JcAjztTjZxDlService;
import cn.com.css.taxInspection.util.TsBqUtils;


@Service("jcAjztTjZxDlService")
public class JcAjztTjZxDlServiceImpl extends ServiceImpl<JcAjztTjZxDlMapper, JcAjztTjZxDlEntity> implements JcAjztTjZxDlService {

	@Override
	@DS("oracle")
	public IPage<JcAjztTjZxDlEntity> infoPage(JcAjztTjZxEntity jcAjztTjZxEntity) {
		Page page = new Page(jcAjztTjZxEntity.getPage(), jcAjztTjZxEntity.getLimit());
		LambdaQueryWrapper<JcAjztTjZxDlEntity> queryWrapper = Wrappers.lambdaQuery();
		
		if(TsBqUtils.isNotNull(jcAjztTjZxEntity.getJcry())){
			queryWrapper.like(JcAjztTjZxDlEntity::getJcry, jcAjztTjZxEntity.getJcry());
		}
		if(TsBqUtils.isNotNull(jcAjztTjZxEntity.getNd())){
			queryWrapper.eq(JcAjztTjZxDlEntity::getNd, jcAjztTjZxEntity.getNd());
		}
		if(TsBqUtils.isNotNull(jcAjztTjZxEntity.getSwjgDm())){
			queryWrapper.eq(JcAjztTjZxDlEntity::getSwjgDm, jcAjztTjZxEntity.getSwjgDm());
		}
		
		IPage<JcAjztTjZxDlEntity> iPage = this.page(page, queryWrapper);
		
		return iPage;
	}
}